//
//  MainNaviVC.swift
//  MedicalUnionHybrid
//
//  Created by 来 on 2019/9/23.
//  Copyright © 2019 EWell. All rights reserved.
//

import UIKit

class MainNaviVC: UINavigationController, UINavigationControllerDelegate {

    var popDelegate: UIGestureRecognizerDelegate?
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.popDelegate = self.interactivePopGestureRecognizer?.delegate
        self.delegate = self
        self.automaticallyAdjustsScrollViewInsets = false
    }
    
    // 横竖屏控制
    override var shouldAutorotate: Bool {
        if LGF_ShouldAutorotate.lgf.lgf_IsShouldAutorotate {
            return true
        } else {
            return false
        }
    }
    
    func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) {
        if viewController == self.viewControllers[0] {
            self.interactivePopGestureRecognizer!.delegate = self.popDelegate
        } else {
            self.interactivePopGestureRecognizer!.delegate = nil
        }
    }
}
